<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Aso Escuelas</title>
        <h:outputStylesheet library="css" name="estilo.css"/>
        <h:outputScript library="js" name="common.js" />        
    </h:head>
    <h:body>
        <p:layout fullPage="true">

            <p:layoutUnit position="north" size="100" resizable="true" closable="true" collapsible="true">
                <ui:insert name="header">
                    <ui:include src="headerUser.xhtml" />
                </ui:insert>
            </p:layoutUnit>

            <p:layoutUnit position="west" size="175" collapsible="true">
                <ui:insert name="menu">
                    <ui:include src="menuUser.xhtml" />
                </ui:insert>
            </p:layoutUnit>

            <p:layoutUnit position="center">


                <h:form id="frmFormulario">

                    <p:dataTable id="lscategoria" 
                                 var="_categoria" 
                                 value="#{GestorCategoriaMaterial.listCategoria}">  

                        <f:facet name="header">
                            Seleccione el Material Bibliografico
                        </f:facet>

                        <p:column>
                            <f:facet name="header">
                                <h:outputText value="Editar"/>
                            </f:facet>
                            <h:commandButton value="Editar" action="#{GestorCategoriaMaterial.editar(_categoria)}"/>
                        </p:column>

                        <p:column headerText="Eliminar">
                            <h:commandButton value="Eliminar" action="#{GestorCategoriaMaterial.eliminar(_categoria)}"/>
                        </p:column>
                        
                        <p:column headerText="Nombre">
                            #{_categoria.nombre}
                        </p:column>
                        <p:column headerText="Descripción">
                            #{_categoria.descripcion}
                        </p:column>

                        <f:facet name="footer">
                            <h:commandButton value="Nuevo" action="#{Action.CrearCategoria()}" />
                            <h:commandButton value="Actualizar" action="#{Action.ListaCategoria()}" />
                        </f:facet>
                        
                    </p:dataTable>
                    <br />
                </h:form>
            </p:layoutUnit>
        </p:layout>
    </h:body>
</html>
